package com.cs342.uwosh.cloudycontacts.tasks.db;
import java.util.ArrayList;
import java.util.List;

import com.cs342.uwosh.cloudycontacts.Contact;
import com.cs342.uwosh.cloudycontacts.MainActivity;
import com.cs342.uwosh.cloudycontacts.SqlConnect;




import android.os.AsyncTask;


public class DeleteChosenContactsTask extends AsyncTask<ArrayList<Contact>, Object, List<Contact>>{

	@Override
	protected List<Contact> doInBackground(ArrayList<Contact>... arg0) {

		SqlConnect db = MainActivity.db;
		ArrayList<Contact> deleteList = arg0[0];
		
		for(int i = 0; i < arg0[0].size(); i++)
		{
			db.deleteContact(deleteList.get(i));
		}
		new GetAllContactTask().execute();
		return null;
	}
}